3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($obj){ static $c; $c = $c ? $c : function(){ return 'baz'; }; $obj->store = $c; } test($x = new stdclass); test($y = new stdclass); var_dump($x === $y);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aso61
function name:  (null)
number of ops:  17
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'test'
          1        NEW                                              $2      'stdclass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                           ~4      !0, $2
          4        SEND_VAL                                                 ~4
          5        DO_FCALL                                      0          
   10     6        INIT_FCALL                                               'test'
          7        NEW                                              $6      'stdclass'
          8        DO_FCALL                                      0          
          9        ASSIGN                                           ~8      !1, $6
         10        SEND_VAL                                                 ~8
         11        DO_FCALL                                      0          
   12    12        INIT_FCALL                                               'var_dump'
         13        IS_IDENTICAL                                     ~10     !0, !1
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aso61
function name:  test
number of ops:  11
compiled vars:  !0 = $obj, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        BIND_STATIC                                              !1
    5     2      > JMPZ                                                     !1, ->5
          3    >   QM_ASSIGN                                        ~2      !1
          4      > JMP                                                      ->7
          5    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Faso61%3A5%240'
          6        QM_ASSIGN                                        ~2      ~3
          7    >   ASSIGN                                                   !1, ~2
    6     8        ASSIGN_OBJ                                               !0, 'store'
          9        OP_DATA                                                  !1
    7    10      > RETURN                                                   null

End of function test

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

End of function %00%7Bclosure%7D%2Fin%2Faso61%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.29 ms | 1399 KiB | 17 Q