3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class TestClass { public static $currentValue; public static function toValue($value) { self::$currentValue = $value; return __CLASS__; } public static function add($value) { self::$currentValue = self::$currentValue + $value; return __CLASS__; } public static function subtract($value) { self::$currentValue = self::$currentValue - $value; return __CLASS__; } public static function result() { return self::$currentValue; } } $value = TestClass::toValue(5)::add(3)::subtract(2)::add(8)::result(); var_dump($value);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iipko
function name:  (null)
number of ops:  23
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   INIT_STATIC_METHOD_CALL                                      'TestClass', 'toValue'
          1        SEND_VAL                                                     5
          2        DO_FCALL                                          0  $1      
          3        FETCH_CLASS                                       0  $2      $1
          4        INIT_STATIC_METHOD_CALL                                      $2, 'add'
          5        SEND_VAL_EX                                                  3
          6        DO_FCALL                                          0  $3      
          7        FETCH_CLASS                                       0  $4      $3
          8        INIT_STATIC_METHOD_CALL                                      $4, 'subtract'
          9        SEND_VAL_EX                                                  2
         10        DO_FCALL                                          0  $5      
         11        FETCH_CLASS                                       0  $6      $5
         12        INIT_STATIC_METHOD_CALL                                      $6, 'add'
         13        SEND_VAL_EX                                                  8
         14        DO_FCALL                                          0  $7      
         15        FETCH_CLASS                                       0  $8      $7
         16        INIT_STATIC_METHOD_CALL                                      $8, 'result'
         17        DO_FCALL                                          0  $9      
         18        ASSIGN                                                       !0, $9
   28    19        INIT_FCALL                                                   'var_dump'
         20        SEND_VAR                                                     !0
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Class TestClass:
Function tovalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iipko
function name:  toValue
number of ops:  5
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        ASSIGN_STATIC_PROP                                           'currentValue'
          2        OP_DATA                                                      !0
    8     3      > RETURN                                                       'TestClass'
    9     4*     > RETURN                                                       null

End of function tovalue

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iipko
function name:  add
number of ops:  7
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
   12     1        FETCH_STATIC_PROP_R              unknown             ~2      'currentValue'
          2        ADD                                                  ~3      ~2, !0
          3        ASSIGN_STATIC_PROP                                           'currentValue'
          4        OP_DATA                                                      ~3
   13     5      > RETURN                                                       'TestClass'
   14     6*     > RETURN                                                       null

End of function add

Function subtract:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iipko
function name:  subtract
number of ops:  7
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
   17     1        FETCH_STATIC_PROP_R              unknown             ~2      'currentValue'
          2        SUB                                                  ~3      ~2, !0
          3        ASSIGN_STATIC_PROP                                           'currentValue'
          4        OP_DATA                                                      ~3
   18     5      > RETURN                                                       'TestClass'
   19     6*     > RETURN                                                       null

End of function subtract

Function result:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iipko
function name:  result
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   FETCH_STATIC_PROP_R              unknown             ~0      'currentValue'
          1      > RETURN                                                       ~0
   23     2*     > RETURN                                                       null

End of function result

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.33 ms | 2080 KiB | 14 Q