3v4l.org

run code in 500+ PHP versions simultaneously
<?php class B{ function action(){ $className = mb_strrchr(static::class, "\\"); return $className === false ? '' : mb_substr($className, 1); } } $b = new B(); var_dump($b->action()); $a = new class extends B { }; var_dump($a->action());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvZ6N
function name:  (null)
number of ops:  18
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   NEW                                                  $2      'B'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   10     3        INIT_FCALL                                                   'var_dump'
          4        INIT_METHOD_CALL                                             !0, 'action'
          5        DO_FCALL                                          0  $5      
          6        SEND_VAR                                                     $5
          7        DO_ICALL                                                     
   13     8        DECLARE_ANON_CLASS                                   <unknown> 'b'
          9        NEW                                                  $8      $7
         10        DO_FCALL                                          0          
         11        ASSIGN                                                       !1, $8
   16    12        INIT_FCALL                                                   'var_dump'
         13        INIT_METHOD_CALL                                             !1, 'action'
         14        DO_FCALL                                          0  $11     
         15        SEND_VAR                                                     $11
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Class B:
Function action:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvZ6N
function name:  action
number of ops:  17
compiled vars:  !0 = $className
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                                   'mb_strrchr'
          1        FETCH_CLASS_NAME                                     ~1      
          2        SEND_VAL                                                     ~1
          3        SEND_VAL                                                     '%5C'
          4        DO_ICALL                                             $2      
          5        ASSIGN                                                       !0, $2
    5     6        TYPE_CHECK                                        4          !0
          7      > JMPZ                                                         ~4, ->10
          8    >   QM_ASSIGN                                            ~5      ''
          9      > JMP                                                          ->15
         10    >   INIT_FCALL                                                   'mb_substr'
         11        SEND_VAR                                                     !0
         12        SEND_VAL                                                     1
         13        DO_ICALL                                             $6      
         14        QM_ASSIGN                                            ~5      $6
         15    > > RETURN                                                       ~5
    6    16*     > RETURN                                                       null

End of function action

End of class B.

Class B@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
134.55 ms | 486 KiB | 10 Q