3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} class Bar { public $baz = 'baz!'; } $foo = new Foo; $foo->bar = function(){ return new Bar; }; $bar = ($foo->bar)(); var_dump($bar->baz);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NEv6c
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   10     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNEv6c%3A10%240'
          4        ASSIGN_OBJ                                               !0, 'bar'
          5        OP_DATA                                                  ~6
   12     6        FETCH_OBJ_R                                      ~7      !0, 'bar'
          7        INIT_DYNAMIC_CALL                                        ~7
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !1, $8
   14    10        INIT_FCALL                                               'var_dump'
         11        FETCH_OBJ_R                                      ~10     !1, 'baz'
         12        SEND_VAL                                                 ~10
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FNEv6c%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NEv6c
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $0      'Bar'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNEv6c%3A10%240

Class Foo: [no user functions]
Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.9 ms | 1395 KiB | 15 Q