3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; private $baz; public function __construct($bar, $baz) { $this->bar = $bar; $this->baz = $baz; } } $foo = new Foo('hello','word'); $string = json_encode($foo); echo $string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sn8JQ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Foo'
          1        SEND_VAL_EX                                              'hello'
          2        SEND_VAL_EX                                              'word'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   16     5        INIT_FCALL                                               'json_encode'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
   17     9        ECHO                                                     !1
         10      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sn8JQ
function name:  __construct
number of ops:  7
compiled vars:  !0 = $bar, !1 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        ASSIGN_OBJ                                               'bar'
          3        OP_DATA                                                  !0
   11     4        ASSIGN_OBJ                                               'baz'
          5        OP_DATA                                                  !1
   12     6      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.11 ms | 1395 KiB | 15 Q