3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { private $private_var; public $public_var = 'Foobar'; public function setPrivate($value) { $this->private_var = $value; } public function __debugInfo() { return json_decode(json_encode($this), true); } } $class = new myClass(); $class->setPrivate("Baz"); print_r($class);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/seDI6
function name:  (null)
number of ops:  10
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'myClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'setPrivate'
          4        SEND_VAL_EX                                              'Baz'
          5        DO_FCALL                                      0          
   22     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class myClass:
Function setprivate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/seDI6
function name:  setPrivate
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        ASSIGN_OBJ                                               'private_var'
          2        OP_DATA                                                  !0
   11     3      > RETURN                                                   null

End of function setprivate

Function __debuginfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/seDI6
function name:  __debugInfo
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'json_decode'
          1        INIT_FCALL                                               'json_encode'
          2        FETCH_THIS                                       ~0      
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $2      
          8      > RETURN                                                   $2
   16     9*     > RETURN                                                   null

End of function __debuginfo

End of class myClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.3 ms | 1448 KiB | 16 Q