3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __construct() { static $restricted; if (!isset($restricted)) { echo "restricted is NOT set\n"; $restricted = "Yes"; } else { echo "restricted IS set\n"; } } } $t = new Test(); $t2 = new Test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BOOb0
function name:  (null)
number of ops:  7
compiled vars:  !0 = $t, !1 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   21     3        NEW                                              $5      'Test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
          6      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BOOb0
function name:  __construct
number of ops:  9
compiled vars:  !0 = $restricted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->7
   10     4    >   ECHO                                                     'restricted+is+NOT+set%0A'
   11     5        ASSIGN                                                   !0, 'Yes'
          6      > JMP                                                      ->8
   15     7    >   ECHO                                                     'restricted+IS+set%0A'
   17     8    > > RETURN                                                   null

End of function __construct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.38 ms | 1394 KiB | 13 Q