3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Example { public function test(); } class MyExample implements Example { public function test() { $args = func_get_args(); if (empty($args)) { throw new \InvalidArgumentException('Test method requires params!'); } foreach($args as $k => $v) { echo "Arg $k given with $v."; } } } $a = new MyExample(); $a->test(); $a->test('Provinding ', 'random', 4, 'args');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hHaBJ
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'myexample'
   22     1        NEW                                              $1      'MyExample'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   23     4        INIT_METHOD_CALL                                         !0, 'test'
          5        DO_FCALL                                      0          
   25     6        INIT_METHOD_CALL                                         !0, 'test'
          7        SEND_VAL_EX                                              'Provinding+'
          8        SEND_VAL_EX                                              'random'
          9        SEND_VAL_EX                                              4
         10        SEND_VAL_EX                                              'args'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

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

End of function test

End of class Example.

Class MyExample:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/hHaBJ
function name:  test
number of ops:  20
compiled vars:  !0 = $args, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FUNC_GET_ARGS                                    ~3      
          1        ASSIGN                                                   !0, ~3
   13     2        ISSET_ISEMPTY_CV                                         !0
          3      > JMPZ                                                     ~5, ->8
   14     4    >   NEW                                              $6      'InvalidArgumentException'
          5        SEND_VAL_EX                                              'Test+method+requires+params%21'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $6
   16     8    > > FE_RESET_R                                       $8      !0, ->18
          9    > > FE_FETCH_R                                       ~9      $8, !1, ->18
         10    >   ASSIGN                                                   !2, ~9
   17    11        ROPE_INIT                                     5  ~12     'Arg+'
         12        ROPE_ADD                                      1  ~12     ~12, !2
         13        ROPE_ADD                                      2  ~12     ~12, '+given+with+'
         14        ROPE_ADD                                      3  ~12     ~12, !1
         15        ROPE_END                                      4  ~11     ~12, '.'
         16        ECHO                                                     ~11
   16    17      > JMP                                                      ->9
         18    >   FE_FREE                                                  $8
   19    19      > RETURN                                                   null

End of function test

End of class MyExample.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.24 ms | 1399 KiB | 13 Q