3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo\Bar\Baz { class Foo{} } namespace { class Bar{} function returnClass($content) { $className = get_class($content); $classNameWithoutNamespace = array_pop(explode('\\', $className)); return lcfirst($classNameWithoutNamespace); } var_dump(returnClass (new \Foo\Bar\Baz\Foo())); var_dump(returnClass (new \Bar())); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lN4ic
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'returnclass'
          2        NEW                                              $0      'Foo%5CBar%5CBaz%5CFoo'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
   17     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'returnclass'
         10        NEW                                              $4      'Bar'
         11        DO_FCALL                                      0          
         12        SEND_VAR                                                 $4
         13        DO_FCALL                                      0  $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
   18    16      > RETURN                                                   1

Function returnclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lN4ic
function name:  returnClass
number of ops:  16
compiled vars:  !0 = $content, !1 = $className, !2 = $classNameWithoutNamespace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        GET_CLASS                                        ~3      !0
          2        ASSIGN                                                   !1, ~3
   12     3        INIT_FCALL                                               'array_pop'
          4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%5C'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        SEND_VAR_NO_REF                               0          $5
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !2, $6
   14    11        INIT_FCALL                                               'lcfirst'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $8      
         14      > RETURN                                                   $8
   15    15*     > RETURN                                                   null

End of function returnclass

Class Foo\Bar\Baz\Foo: [no user functions]
Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.21 ms | 1399 KiB | 23 Q