3v4l.org

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

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/UCiPv
function name:  test
number of ops:  10
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
    6     2        ISSET_ISEMPTY_CV                                 ~2      !1
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->7
    7     5    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUCiPv%3A7%240'
          6        ASSIGN                                                   !1, ~4
    9     7    >   ASSIGN_OBJ                                               !0, 'store'
          8        OP_DATA                                                  !1
   10     9      > RETURN                                                   null

End of function test

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

End of function %00%7Bclosure%7D%2Fin%2FUCiPv%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.97 ms | 1398 KiB | 17 Q