3v4l.org

run code in 300+ PHP versions simultaneously
<?php function logger($thing) { var_dump($thing); } class OtherClass { const MY_CONSTANT = 42; } class Foo { function bar($param = OtherClass::MY_CONSTANT) { logger(__METHOD__); logger(OtherClass::MY_CONSTANT); logger($param); logger('ready to do stuff'); // does stuff } } $f = new Foo(); $f->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecDZE
function name:  (null)
number of ops:  6
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function logger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecDZE
function name:  logger
number of ops:  5
compiled vars:  !0 = $thing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    5     4      > RETURN                                                   null

End of function logger

Class OtherClass: [no user functions]
Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecDZE
function name:  bar
number of ops:  14
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV_INIT                                        !0      <const ast>
   14     1        INIT_FCALL                                               'logger'
          2        SEND_VAL                                                 'Foo%3A%3Abar'
          3        DO_FCALL                                      0          
   15     4        INIT_FCALL                                               'logger'
          5        SEND_VAL                                                 42
          6        DO_FCALL                                      0          
   16     7        INIT_FCALL                                               'logger'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0          
   17    10        INIT_FCALL                                               'logger'
         11        SEND_VAL                                                 'ready+to+do+stuff'
         12        DO_FCALL                                      0          
   20    13      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.44 ms | 1013 KiB | 18 Q