3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function map(array $routes = [], array $options = []) {} } class B extends A { public function map(array $routes = [], ?array $options = null) {} } $b = new B(); $b->map([], []); $b->map([], null); $a = new A(); $a->map([], []); $a->map([], null); // Fatal error
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OYbIf
function name:  (null)
number of ops:  23
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   12     3        INIT_METHOD_CALL                                         !0, 'map'
          4        SEND_VAL_EX                                              <array>
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
   13     7        INIT_METHOD_CALL                                         !0, 'map'
          8        SEND_VAL_EX                                              <array>
          9        SEND_VAL_EX                                              null
         10        DO_FCALL                                      0          
   15    11        NEW                                              $7      'A'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $7
   16    14        INIT_METHOD_CALL                                         !1, 'map'
         15        SEND_VAL_EX                                              <array>
         16        SEND_VAL_EX                                              <array>
         17        DO_FCALL                                      0          
   17    18        INIT_METHOD_CALL                                         !1, 'map'
         19        SEND_VAL_EX                                              <array>
         20        SEND_VAL_EX                                              null
         21        DO_FCALL                                      0          
         22      > RETURN                                                   1

Class A:
Function map:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OYbIf
function name:  map
number of ops:  3
compiled vars:  !0 = $routes, !1 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      <array>
          1        RECV_INIT                                        !1      <array>
          2      > RETURN                                                   null

End of function map

End of class A.

Class B:
Function map:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OYbIf
function name:  map
number of ops:  3
compiled vars:  !0 = $routes, !1 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_INIT                                        !0      <array>
          1        RECV_INIT                                        !1      null
          2      > RETURN                                                   null

End of function map

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.98 ms | 1399 KiB | 13 Q