3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyClass { private $hi = 'Hi'; protected $hello = 'Hello'; public $goodday = 'Goodday'; } $thing = new MyClass(); print json_encode($thing); // {"goodday":"Goodday"} print json_encode((array) $thing); // {"\u0000MyClass\u0000hi":"Hi","\u0000*\u0000hello":"Hello","goodday":"Goodday"}
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AfOPT
function name:  (null)
number of ops:  13
compiled vars:  !0 = $thing
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   NEW                                                  $1      'MyClass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   10     3        INIT_FCALL                                                   'json_encode'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $4      
          6        ECHO                                                         $4
   12     7        INIT_FCALL                                                   'json_encode'
          8        CAST                                              7  ~5      !0
          9        SEND_VAL                                                     ~5
         10        DO_ICALL                                             $6      
         11        ECHO                                                         $6
   13    12      > RETURN                                                       1

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
131.67 ms | 1473 KiB | 14 Q