3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ public function __invoke($arg){ echo __METHOD__ . "($arg) called" . PHP_EOL; return $this; } } $a = new A(); $a(0); $a(1)(2)(3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/37dhb
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   11     3        INIT_DYNAMIC_CALL                                        !0
          4        SEND_VAL_EX                                              0
          5        DO_FCALL                                      0          
   12     6        INIT_DYNAMIC_CALL                                        !0
          7        SEND_VAL_EX                                              1
          8        DO_FCALL                                      0  $5      
          9        INIT_DYNAMIC_CALL                                        $5
         10        SEND_VAL_EX                                              2
         11        DO_FCALL                                      0  $6      
         12        INIT_DYNAMIC_CALL                                        $6
         13        SEND_VAL_EX                                              3
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Class A:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/37dhb
function name:  __invoke
number of ops:  10
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ROPE_INIT                                     3  ~2      '%28'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%29+called'
          4        CONCAT                                           ~4      'A%3A%3A__invoke', ~1
          5        CONCAT                                           ~5      ~4, '%0A'
          6        ECHO                                                     ~5
    6     7        FETCH_THIS                                       ~6      
          8      > RETURN                                                   ~6
    7     9*     > RETURN                                                   null

End of function __invoke

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.44 ms | 1007 KiB | 13 Q