3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = function(){ static $run = 0; if ($run) { throw new Exception("I've already been run!"); } $run = 1; echo "I'm running\n"; }; $f(); $f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3sl9T
function name:  (null)
number of ops:  7
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3sl9T%3A3%240'
          1        ASSIGN                                                   !0, ~1
   13     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   14     4        INIT_DYNAMIC_CALL                                        !0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3sl9T%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3sl9T
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $run
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    5     1      > JMPZ                                                     !0, ->6
    6     2    >   NEW                                              $1      'Exception'
          3        SEND_VAL_EX                                              'I%27ve+already+been+run%21'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $1
    8     6    >   ASSIGN                                                   !0, 1
   10     7        ECHO                                                     'I%27m+running%0A'
   11     8      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3sl9T%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.92 ms | 1394 KiB | 13 Q