3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Hello world; This is a nice day; after"; $str = explode(";",$string); $size=sizeof($str); $newstr = array(); $newstr[0] = $str[$size-1]; $newstr[1] = "--".substr($string, 0, strrpos($string, ";"))."--"; print_r($newstr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kvmj6
function name:  (null)
number of ops:  30
compiled vars:  !0 = $string, !1 = $str, !2 = $size, !3 = $newstr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hello+world%3B+This+is+a+nice+day%3B+after'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%3B'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    5     6        COUNT                                            ~7      !1
          7        ASSIGN                                                   !2, ~7
    6     8        ASSIGN                                                   !3, <array>
    7     9        SUB                                              ~11     !2, 1
         10        FETCH_DIM_R                                      ~12     !1, ~11
         11        ASSIGN_DIM                                               !3, 0
         12        OP_DATA                                                  ~12
    8    13        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 0
         16        INIT_FCALL                                               'strrpos'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 '%3B'
         19        DO_ICALL                                         $14     
         20        SEND_VAR                                                 $14
         21        DO_ICALL                                         $15     
         22        CONCAT                                           ~16     '--', $15
         23        CONCAT                                           ~17     ~16, '--'
         24        ASSIGN_DIM                                               !3, 1
         25        OP_DATA                                                  ~17
    9    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.11 ms | 1395 KiB | 21 Q