3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(hello); function atom(...$atoms) { array_walk( $atoms, function ($atom) { if (defined($atom)) { if ($atom !== constant($atom)) raise("The atom is already defined with a different value: ".$atom); } else { define($atom, $atom); } } ); } atom(@atom); atom(@raise); atom(@dispatch); atom(@acceptsmessage); atom(@isatom); var_dump(@atom);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/39e5T
function name:  (null)
number of ops:  41
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CONSTANT                                   ~0      'hello'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   16     4        INIT_FCALL                                               'atom'
          5        BEGIN_SILENCE                                    ~2      
          6        FETCH_CONSTANT                                   ~3      'atom'
          7        END_SILENCE                                              ~2
          8        SEND_VAL                                                 ~3
          9        DO_FCALL                                      0          
   17    10        INIT_FCALL                                               'atom'
         11        BEGIN_SILENCE                                    ~5      
         12        FETCH_CONSTANT                                   ~6      'raise'
         13        END_SILENCE                                              ~5
         14        SEND_VAL                                                 ~6
         15        DO_FCALL                                      0          
   18    16        INIT_FCALL                                               'atom'
         17        BEGIN_SILENCE                                    ~8      
         18        FETCH_CONSTANT                                   ~9      'dispatch'
         19        END_SILENCE                                              ~8
         20        SEND_VAL                                                 ~9
         21        DO_FCALL                                      0          
   19    22        INIT_FCALL                                               'atom'
         23        BEGIN_SILENCE                                    ~11     
         24        FETCH_CONSTANT                                   ~12     'acceptsmessage'
         25        END_SILENCE                                              ~11
         26        SEND_VAL                                                 ~12
         27        DO_FCALL                                      0          
   20    28        INIT_FCALL                                               'atom'
         29        BEGIN_SILENCE                                    ~14     
         30        FETCH_CONSTANT                                   ~15     'isatom'
         31        END_SILENCE                                              ~14
         32        SEND_VAL                                                 ~15
         33        DO_FCALL                                      0          
   22    34        INIT_FCALL                                               'var_dump'
         35        BEGIN_SILENCE                                    ~17     
         36        FETCH_CONSTANT                                   ~18     'atom'
         37        END_SILENCE                                              ~17
         38        SEND_VAL                                                 ~18
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Function atom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/39e5T
function name:  atom
number of ops:  7
compiled vars:  !0 = $atoms
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_VARIADIC                                    !0      
    5     1        INIT_FCALL                                               'array_walk'
    6     2        SEND_REF                                                 !0
    7     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F39e5T%3A7%240'
   13     4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
   15     6      > RETURN                                                   null

End of function atom

Function %00%7Bclosure%7D%2Fin%2F39e5T%3A7%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/39e5T
function name:  {closure}
number of ops:  20
compiled vars:  !0 = $atom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'defined'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > JMPZ                                                     $1, ->15
    9     5    >   INIT_FCALL                                               'constant'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $2      
          8        IS_NOT_IDENTICAL                                         !0, $2
          9      > JMPZ                                                     ~3, ->14
         10    >   INIT_FCALL_BY_NAME                                       'raise'
         11        CONCAT                                           ~4      'The+atom+is+already+defined+with+a+different+value%3A+', !0
         12        SEND_VAL_EX                                              ~4
         13        DO_FCALL                                      0          
         14    > > JMP                                                      ->19
   11    15    >   INIT_FCALL                                               'define'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
   13    19    > > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.05 ms | 1403 KiB | 28 Q