3v4l.org

run code in 300+ PHP versions simultaneously
<?php $throwableName = 'Hello\World\Class\ClassName'; $classNameArr = explode('\\', $throwableName); $className = implode('\\', array_map(function($item){ return $item[0]; }, array_slice($classNameArr, 0, -1))).'\\'.$classNameArr[count($classNameArr) - 1]; var_dump($className);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MAmlH
function name:  (null)
number of ops:  30
compiled vars:  !0 = $throwableName, !1 = $classNameArr, !2 = $className
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hello%5CWorld%5CClass%5CClassName'
    6     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%5C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    7     6        INIT_FCALL                                               'implode'
          7        SEND_VAL                                                 '%5C'
          8        INIT_FCALL                                               'array_map'
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMAmlH%3A7%240'
         10        SEND_VAL                                                 ~6
         11        INIT_FCALL                                               'array_slice'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 -1
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                         $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                         $9      
         20        CONCAT                                           ~10     $9, '%5C'
         21        COUNT                                            ~11     !1
         22        SUB                                              ~12     ~11, 1
         23        FETCH_DIM_R                                      ~13     !1, ~12
         24        CONCAT                                           ~14     ~10, ~13
         25        ASSIGN                                                   !2, ~14
    9    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FMAmlH%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MAmlH
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMAmlH%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.5 ms | 1396 KiB | 23 Q