3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Additive { public function getSigma($rSigma); } class Sigma implements Additive { protected $_fValue = null; public function __construct($fValue) { $this->_fValue = (double)$fValue; } public static function __callStatic($sName, $rgArgs) { if(count($rgArgs)!=count(array_filter($rgArgs, function($mArg) { return is_object($mArg) && $mArg instanceof self; }))) { throw new Exception('Can not call method "'.$sName.'": invalid arguments'); } if(!count($rgArgs)) { return null; } $rResult = array_shift($rgArgs); foreach($rgArgs as $mArg) { $rResult = $rResult->$sName($mArg); } return $rResult; } public function getValue() { return $this->_fValue; } public function getSigma($rSigma) { return new self($this->getValue()+$rSigma->getValue()); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OLX0u
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'sigma'
   48     1      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FOLX0u%3A19%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/OLX0u
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $mArg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        TYPE_CHECK                                  256  ~1      !0
          2      > JMPZ_EX                                          ~1      ~1, ->5
          3    >   INSTANCEOF                                       ~2      !0
          4        BOOL                                             ~1      ~2
          5    > > RETURN                                                   ~1
   22     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FOLX0u%3A19%240

Class Additive:
Function getsigma:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OLX0u
function name:  getSigma
number of ops:  2
compiled vars:  !0 = $rSigma
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function getsigma

End of class Additive.

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

End of function __construct

Function __callstatic:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/OLX0u
function name:  __callStatic
number of ops:  35
compiled vars:  !0 = $sName, !1 = $rgArgs, !2 = $rResult, !3 = $mArg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        COUNT                                            ~4      !1
          3        INIT_FCALL                                               'array_filter'
          4        SEND_VAR                                                 !1
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOLX0u%3A19%240'
   22     6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        COUNT                                            ~7      $6
          9        IS_NOT_EQUAL                                             ~4, ~7
         10      > JMPZ                                                     ~8, ->17
   24    11    >   NEW                                              $9      'Exception'
         12        CONCAT                                           ~10     'Can+not+call+method+%22', !0
         13        CONCAT                                           ~11     ~10, '%22%3A+invalid+arguments'
         14        SEND_VAL_EX                                              ~11
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $9
   26    17    >   COUNT                                            ~13     !1
         18        BOOL_NOT                                         ~14     ~13
         19      > JMPZ                                                     ~14, ->21
   28    20    > > RETURN                                                   null
   30    21    >   INIT_FCALL                                               'array_shift'
         22        SEND_REF                                                 !1
         23        DO_ICALL                                         $15     
         24        ASSIGN                                                   !2, $15
   31    25      > FE_RESET_R                                       $17     !1, ->32
         26    > > FE_FETCH_R                                               $17, !3, ->32
   33    27    >   INIT_METHOD_CALL                                         !2, !0
         28        SEND_VAR_EX                                              !3
         29        DO_FCALL                                      0  $18     
         30        ASSIGN                                                   !2, $18
   31    31      > JMP                                                      ->26
         32    >   FE_FREE                                                  $17
   35    33      > RETURN                                                   !2
   36    34*     > RETURN                                                   null

End of function __callstatic

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OLX0u
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   FETCH_OBJ_R                                      ~0      '_fValue'
          1      > RETURN                                                   ~0
   41     2*     > RETURN                                                   null

End of function getvalue

Function getsigma:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OLX0u
function name:  getSigma
number of ops:  11
compiled vars:  !0 = $rSigma
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   RECV                                             !0      
   45     1        NEW                          self                $1      
          2        INIT_METHOD_CALL                                         'getValue'
          3        DO_FCALL                                      0  $2      
          4        INIT_METHOD_CALL                                         !0, 'getValue'
          5        DO_FCALL                                      0  $3      
          6        ADD                                              ~4      $2, $3
          7        SEND_VAL_EX                                              ~4
          8        DO_FCALL                                      0          
          9      > RETURN                                                   $1
   46    10*     > RETURN                                                   null

End of function getsigma

End of class Sigma.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.75 ms | 1404 KiB | 17 Q