3v4l.org

run code in 300+ PHP versions simultaneously
<?php class JsonSerializer { public static function serialize($value) { //var_dump($value); } public function __call($method, $args) { var_dump($method); if ('serialize' !== strtolower('serialize')) { throw new \BadMethodCallException('Call to undefined method '.__METHOD__); } return self::serialize(...$args); } } JsonSerializer::serialize('foo'); (new JsonSerializer())->serialize('bar'); (new JsonSerializer())->baz('qux');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XrIZo
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                  'JsonSerializer', 'serialize'
          1        SEND_VAL                                                 'foo'
          2        DO_FCALL                                      0          
   22     3        NEW                                              $1      'JsonSerializer'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $1, 'serialize'
          6        SEND_VAL_EX                                              'bar'
          7        DO_FCALL                                      0          
   23     8        NEW                                              $4      'JsonSerializer'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $4, 'baz'
         11        SEND_VAL_EX                                              'qux'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

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

End of function serialize

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XrIZo
function name:  __call
number of ops:  20
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   13     5        INIT_FCALL                                               'strtolower'
          6        SEND_VAL                                                 'serialize'
          7        DO_ICALL                                         $3      
          8        IS_NOT_IDENTICAL                                         $3, 'serialize'
          9      > JMPZ                                                     ~4, ->14
   14    10    >   NEW                                              $5      'BadMethodCallException'
         11        SEND_VAL_EX                                              'Call+to+undefined+method+JsonSerializer%3A%3A__call'
         12        DO_FCALL                                      0          
         13      > THROW                                         0          $5
   17    14    >   INIT_STATIC_METHOD_CALL                                  'serialize'
         15        SEND_UNPACK                                              !1
         16        CHECK_UNDEF_ARGS                                         
         17        DO_FCALL                                      1  $7      
         18      > RETURN                                                   $7
   18    19*     > RETURN                                                   null

End of function __call

End of class JsonSerializer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.24 ms | 1400 KiB | 17 Q