3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const ONE = "Number one"; const TWO = "Number two"; } $obj = new ReflectionClass( "Test" ); echo $obj->getconstant( "ONE" )."\n"; echo $obj->getconstant( "TWO" )."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AhAHP
function name:  (null)
number of ops:  15
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
    6     4        INIT_METHOD_CALL                                         !0, 'getconstant'
          5        SEND_VAL_EX                                              'ONE'
          6        DO_FCALL                                      0  $4      
          7        CONCAT                                           ~5      $4, '%0A'
          8        ECHO                                                     ~5
    7     9        INIT_METHOD_CALL                                         !0, 'getconstant'
         10        SEND_VAL_EX                                              'TWO'
         11        DO_FCALL                                      0  $6      
         12        CONCAT                                           ~7      $6, '%0A'
         13        ECHO                                                     ~7
         14      > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.7 ms | 1392 KiB | 13 Q