3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { const FOOBAR = 'baz'; public function test($name) { $constant = get_class($this) . '::' . $name; $value = constant($constant); return $value; } } $e = new Example; var_dump($e->test('1234'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7QTNV
function name:  (null)
number of ops:  10
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Example'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'test'
          5        SEND_VAL_EX                                              '1234'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class Example:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7QTNV
function name:  test
number of ops:  12
compiled vars:  !0 = $name, !1 = $constant, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_THIS                                       ~3      
          2        GET_CLASS                                        ~4      ~3
          3        CONCAT                                           ~5      ~4, '%3A%3A'
          4        CONCAT                                           ~6      ~5, !0
          5        ASSIGN                                                   !1, ~6
    7     6        INIT_FCALL                                               'constant'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
    8    10      > RETURN                                                   !2
    9    11*     > RETURN                                                   null

End of function test

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.52 ms | 1395 KiB | 17 Q