3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); trait Foo{ public function bar(int $int){ echo $int * 2; } public function callBar(){ $this->bar(123); } } class A{ use Foo; public function bar(string $string){ // incompatible signature! // prevents callBar from working correctly } } $a = new A; $a->bar("123"); $a->callBar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ca8CP
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_CLASS                                            'a'
   24     1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   26     4        INIT_METHOD_CALL                                         !0, 'bar'
          5        SEND_VAL_EX                                              '123'
          6        DO_FCALL                                      0          
   27     7        INIT_METHOD_CALL                                         !0, 'callBar'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ca8CP
function name:  bar
number of ops:  4
compiled vars:  !0 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        MUL                                              ~1      !0, 2
          2        ECHO                                                     ~1
    8     3      > RETURN                                                   null

End of function bar

Function callbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ca8CP
function name:  callBar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_METHOD_CALL                                         'bar'
          1        SEND_VAL_EX                                              123
          2        DO_FCALL                                      0          
   12     3      > RETURN                                                   null

End of function callbar

End of class Foo.

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

End of function bar

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
206.62 ms | 1000 KiB | 13 Q