3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const LOL = 'hahaha'; } class Bar { function getFoo() { return Foo::class; } } $bar = new Bar; var_dump($bar->getFoo()::LOL);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cAiYN
function name:  (null)
number of ops:  11
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getFoo'
          5        DO_FCALL                                      0  $4      
          6        FETCH_CLASS                                   0  $5      $4
          7        FETCH_CLASS_CONSTANT                             ~6      $5, 'LOL'
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function getfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cAiYN
function name:  getFoo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   'Foo'
   13     1*     > RETURN                                                   null

End of function getfoo

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.29 ms | 939 KiB | 16 Q