3v4l.org

run code in 300+ PHP versions simultaneously
<?php $chapter_full_path = "/test/eeee/last/"; $chapter_path_name = "last"; $chapter_path_name_length=strlen($chapter_path_name); $oldParentFullPathLength = strlen($chapter_full_path) - $chapter_path_name_length; $oldParentFullPath=substr($chapter_full_path,0,$oldParentFullPathLength); echo $oldParentFullPath;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JtA9f
function name:  (null)
number of ops:  15
compiled vars:  !0 = $chapter_full_path, !1 = $chapter_path_name, !2 = $chapter_path_name_length, !3 = $oldParentFullPathLength, !4 = $oldParentFullPath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2Ftest%2Feeee%2Flast%2F'
    3     1        ASSIGN                                                   !1, 'last'
    4     2        STRLEN                                           ~7      !1
          3        ASSIGN                                                   !2, ~7
    5     4        STRLEN                                           ~9      !0
          5        SUB                                              ~10     ~9, !2
          6        ASSIGN                                                   !3, ~10
    6     7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 0
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                         $12     
         12        ASSIGN                                                   !4, $12
    8    13        ECHO                                                     !4
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.84 ms | 1394 KiB | 15 Q