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/au6VB
function name:  (null)
number of ops:  28
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'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%3B'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        COUNT                                            ~7      !1
          7        ASSIGN                                                   !2, ~7
    7     8        ASSIGN                                                   !3, <array>
    8     9        SUB                                              ~11     !2, 1
         10        FETCH_DIM_R                                      ~12     !1, ~11
         11        ASSIGN_DIM                                               !3, 0
         12        OP_DATA                                                  ~12
    9    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        ASSIGN_DIM                                               !3, 1
         23        OP_DATA                                                  $15
   10    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.72 ms | 1399 KiB | 22 Q