3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Manager { public $content_storage=''; public function __toString() { return $this->content_storage; } public function __call($name,array $params) { $this->content_storage.=$this->_GetObject($name,$params).'<br>'.PHP_EOL; return $this; } } abstract class EntryClass { public static function Launch() { return new FluentInterface; } } class FluentInterface extends Manager { public function __construct() { /** * Что-нибудь инициализируем */ } public static function _GetObject($n,array $params) { return $n; } } echo $FI=EntryClass::Launch() ->First() ->Second() ->Third(); /* Выведет First Second Third */ ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NDWJK
function name:  (null)
number of ops:  13
compiled vars:  !0 = $FI
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'manager'
   27     1        DECLARE_CLASS                                            'fluentinterface', 'manager'
   42     2        INIT_STATIC_METHOD_CALL                                  'EntryClass', 'Launch'
          3        DO_FCALL                                      0  $1      
   43     4        INIT_METHOD_CALL                                         $1, 'First'
          5        DO_FCALL                                      0  $2      
   44     6        INIT_METHOD_CALL                                         $2, 'Second'
          7        DO_FCALL                                      0  $3      
   45     8        INIT_METHOD_CALL                                         $3, 'Third'
          9        DO_FCALL                                      0  $4      
   42    10        ASSIGN                                           ~5      !0, $4
         11        ECHO                                                     ~5
   52    12      > RETURN                                                   1

Class Manager:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NDWJK
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'content_storage'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   10     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NDWJK
function name:  __call
number of ops:  13
compiled vars:  !0 = $name, !1 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        INIT_METHOD_CALL                                         '_GetObject'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $3      
          6        CONCAT                                           ~4      $3, '%3Cbr%3E'
          7        CONCAT                                           ~5      ~4, '%0A'
          8        ASSIGN_OBJ_OP                                 8          'content_storage'
          9        OP_DATA                                                  ~5
   15    10        FETCH_THIS                                       ~6      
         11      > RETURN                                                   ~6
   16    12*     > RETURN                                                   null

End of function __call

End of class Manager.

Class EntryClass:
Function launch:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NDWJK
function name:  Launch
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $0      'FluentInterface'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   24     3*     > RETURN                                                   null

End of function launch

End of class EntryClass.

Class FluentInterface:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NDWJK
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E > > RETURN                                                   null

End of function __construct

Function _getobject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NDWJK
function name:  _GetObject
number of ops:  4
compiled vars:  !0 = $n, !1 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   38     2      > RETURN                                                   !0
   39     3*     > RETURN                                                   null

End of function _getobject

End of class FluentInterface.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.89 ms | 1399 KiB | 13 Q