3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($obj){ static $c; var_dump($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/u8Qbp
function name:  (null)
number of ops:  17
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     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          
   11     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          
   13    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 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u8Qbp
function name:  test
number of ops:  14
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        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                                 
    6     5      > JMPZ                                                     !1, ->8
          6    >   QM_ASSIGN                                        ~3      !1
          7      > JMP                                                      ->10
          8    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fu8Qbp%3A6%240'
          9        QM_ASSIGN                                        ~3      ~4
         10    >   ASSIGN                                                   !1, ~3
    7    11        ASSIGN_OBJ                                               !0, 'store'
         12        OP_DATA                                                  !1
    8    13      > RETURN                                                   null

End of function test

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

End of function %00%7Bclosure%7D%2Fin%2Fu8Qbp%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.45 ms | 1403 KiB | 17 Q