Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
error_reporting(E_ALL);
$res = $mysqli->query('SELECT 42');
$obj = $res->fetch_object();
var_dump($obj);
$prop = 42;
echo "before: ",$obj->{$prop},"\n";
$obj = json_decode(json_encode($obj));
echo "after: ",$obj->{$prop},"\n";