3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ScreenLogger { public function debug($message, $data) { echo $message . "<br>" . var_export($data, true) . "<hr>"; } } class ExampleClass { public $logger; public function __construct($logger = null) { $this->logger = $logger; } public function __invoke() { if ($this->logger) { echo "hooray!"; } } } $logger = new ScreenLogger(); $example = new ExampleClass($logger); echo var_export($example->logger, true) . "\n"; $example();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JY8SO
function name:  (null)
number of ops:  17
compiled vars:  !0 = $logger, !1 = $example
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'ScreenLogger'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   26     3        NEW                                              $5      'ExampleClass'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   27     7        INIT_FCALL                                               'var_export'
          8        FETCH_OBJ_R                                      ~8      !1, 'logger'
          9        SEND_VAL                                                 ~8
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $9      
         12        CONCAT                                           ~10     $9, '%0A'
         13        ECHO                                                     ~10
   28    14        INIT_DYNAMIC_CALL                                        !1
         15        DO_FCALL                                      0          
         16      > RETURN                                                   1

Class ScreenLogger:
Function debug:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JY8SO
function name:  debug
number of ops:  11
compiled vars:  !0 = $message, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        CONCAT                                           ~2      !0, '%3Cbr%3E'
          3        INIT_FCALL                                               'var_export'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $3      
          7        CONCAT                                           ~4      ~2, $3
          8        CONCAT                                           ~5      ~4, '%3Chr%3E'
          9        ECHO                                                     ~5
    7    10      > RETURN                                                   null

End of function debug

End of class ScreenLogger.

Class ExampleClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JY8SO
function name:  __construct
number of ops:  4
compiled vars:  !0 = $logger
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV_INIT                                        !0      null
   14     1        ASSIGN_OBJ                                               'logger'
          2        OP_DATA                                                  !0
   15     3      > RETURN                                                   null

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 3
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
filename:       /in/JY8SO
function name:  __invoke
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'logger'
          1      > JMPZ                                                     ~0, ->3
   20     2    >   ECHO                                                     'hooray%21'
   22     3    > > RETURN                                                   null

End of function __invoke

End of class ExampleClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.53 ms | 1404 KiB | 16 Q