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) { if ('serialize' !== strtolower('serialize')) { throw new \BadMethodCallException('...'); } return self::serialize(...$args); } } $serializer = new JsonSerializer(); $serializer->serialize('foo'); JsonSerializer::serialize('bar');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XlkQJ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $serializer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'JsonSerializer'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'serialize'
          4        SEND_VAL_EX                                              'foo'
          5        DO_FCALL                                      0          
   22     6        INIT_STATIC_METHOD_CALL                                  'JsonSerializer', 'serialize'
          7        SEND_VAL                                                 'bar'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function serialize

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XlkQJ
function name:  __call
number of ops:  17
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                                               'strtolower'
          3        SEND_VAL                                                 'serialize'
          4        DO_ICALL                                         $2      
          5        IS_NOT_IDENTICAL                                         $2, 'serialize'
          6      > JMPZ                                                     ~3, ->11
   13     7    >   NEW                                              $4      'BadMethodCallException'
          8        SEND_VAL_EX                                              '...'
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $4
   16    11    >   INIT_STATIC_METHOD_CALL                                  'serialize'
         12        SEND_UNPACK                                              !1
         13        CHECK_UNDEF_ARGS                                         
         14        DO_FCALL                                      1  $6      
         15      > RETURN                                                   $6
   17    16*     > RETURN                                                   null

End of function __call

End of class JsonSerializer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.99 ms | 1400 KiB | 17 Q