3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pipe(&$_) { return new class($_) { private $_; public function __construct(&$_) { $this->$_ = &$_; } public function __call(string $name, array $args) : self { $this->_ = $name(...$args); return $this; } }; } pipe($blah)->strtoupper('hello')->strrev($blah); echo $blah;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vee4L
function name:  (null)
number of ops:  11
compiled vars:  !0 = $blah
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'pipe'
          1        SEND_REF                                                 !0
          2        DO_FCALL                                      0  $1      
          3        INIT_METHOD_CALL                                         $1, 'strtoupper'
          4        SEND_VAL_EX                                              'hello'
          5        DO_FCALL                                      0  $2      
          6        INIT_METHOD_CALL                                         $2, 'strrev'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   19     9        ECHO                                                     !0
         10      > RETURN                                                   1

Function pipe:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vee4L
function name:  pipe
number of ops:  7
compiled vars:  !0 = $_
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        DECLARE_ANON_CLASS                               <undef> 
          2        NEW                                              $2      $1
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   $2
   16     6*     > RETURN                                                   null

End of function pipe

Class class@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vee4L
function name:  __construct
number of ops:  4
compiled vars:  !0 = $_
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ_REF                                           !0
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vee4L
function name:  __call
number of ops:  13
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        INIT_DYNAMIC_CALL                                        !0
          3        SEND_UNPACK                                              !1
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      1  $3      
          6        ASSIGN_OBJ                                               '_'
          7        OP_DATA                                                  $3
   13     8        FETCH_THIS                                       ~4      
          9        VERIFY_RETURN_TYPE                                       ~4
         10      > RETURN                                                   ~4
   14    11*       VERIFY_RETURN_TYPE                                       
         12*     > RETURN                                                   null

End of function __call

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.21 ms | 1403 KiB | 14 Q