3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace a { class a { public static function test() { $ns = get_called_class(); $ns = substr($ns, 0, strrpos($ns, '\\')); $ns = $ns."\Model"; echo $ns; } } } namespace b { class b extends \a\a { } } namespace { \b\b::test(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BVMti
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_STATIC_METHOD_CALL                                  'b%5Cb', 'test'
          1        DO_FCALL                                      0          
   19     2      > RETURN                                                   1

Class a\a:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BVMti
function name:  test
number of ops:  17
compiled vars:  !0 = $ns
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_NS_FCALL_BY_NAME                                    'a%5Cget_called_class'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    6     3        INIT_NS_FCALL_BY_NAME                                    'a%5Csubstr'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAL_EX                                              0
          6        INIT_NS_FCALL_BY_NAME                                    'a%5Cstrrpos'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAL_EX                                              '%5C'
          9        DO_FCALL                                      0  $3      
         10        SEND_VAR_NO_REF_EX                                       $3
         11        DO_FCALL                                      0  $4      
         12        ASSIGN                                                   !0, $4
    7    13        CONCAT                                           ~6      !0, '%5CModel'
         14        ASSIGN                                                   !0, ~6
    8    15        ECHO                                                     !0
    9    16      > RETURN                                                   null

End of function test

End of class a\a.

Class b\b:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BVMti
function name:  test
number of ops:  17
compiled vars:  !0 = $ns
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_NS_FCALL_BY_NAME                                    'a%5Cget_called_class'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    6     3        INIT_NS_FCALL_BY_NAME                                    'a%5Csubstr'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAL_EX                                              0
          6        INIT_NS_FCALL_BY_NAME                                    'a%5Cstrrpos'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAL_EX                                              '%5C'
          9        DO_FCALL                                      0  $3      
         10        SEND_VAR_NO_REF_EX                                       $3
         11        DO_FCALL                                      0  $4      
         12        ASSIGN                                                   !0, $4
    7    13        CONCAT                                           ~6      !0, '%5CModel'
         14        ASSIGN                                                   !0, ~6
    8    15        ECHO                                                     !0
    9    16      > RETURN                                                   null

End of function test

End of class b\b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.89 ms | 1400 KiB | 19 Q