3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { const TEST_CONST1 = true; define("TEST_CONST2", true); function testExistConst() { var_dump(constant("TEST_CONST1")); var_dump(constant("TEST_CONST2")); var_dump(TEST_CONST1); var_dump(TEST_CONST2); } testExistConst(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vHOk6
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CONST                                            'TEST_CONST1', <true>
    5     1        INIT_FCALL                                               'define'
          2        SEND_VAL                                                 'TEST_CONST2'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                                 
   13     5        INIT_FCALL                                               'testexistconst'
          6        DO_FCALL                                      0          
   14     7      > RETURN                                                   1

Function testexistconst:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vHOk6
function name:  testExistConst
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'constant'
          2        SEND_VAL                                                 'TEST_CONST1'
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
    9     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'constant'
          8        SEND_VAL                                                 'TEST_CONST2'
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
   10    12        INIT_FCALL                                               'var_dump'
         13        FETCH_CONSTANT                                   ~4      'TEST_CONST1'
         14        SEND_VAL                                                 ~4
         15        DO_ICALL                                                 
   11    16        INIT_FCALL                                               'var_dump'
         17        FETCH_CONSTANT                                   ~6      'TEST_CONST2'
         18        SEND_VAL                                                 ~6
         19        DO_ICALL                                                 
   12    20      > RETURN                                                   null

End of function testexistconst

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.66 ms | 1399 KiB | 20 Q