3v4l.org

run code in 300+ PHP versions simultaneously
<?php $address = '5e Dorpsstraat 41B'; $matchArr = array(); preg_match_all('/(\d+)/', $address, $matchArr); var_dump($matchArr); $number = array_pop(array_pop($matchArr)); $split = explode($number, $address); $lastPart = $number . array_pop($split); $firstPart = implode($number, $split); print 'First part: ' . $firstPart . "\n"; print 'Last part: ' . $lastPart . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3o3fn
function name:  (null)
number of ops:  39
compiled vars:  !0 = $address, !1 = $matchArr, !2 = $number, !3 = $split, !4 = $lastPart, !5 = $firstPart
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '5e+Dorpsstraat+41B'
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%2F%28%5Cd%2B%29%2F'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
          6        DO_ICALL                                                 
    6     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    7    10        INIT_FCALL                                               'array_pop'
         11        INIT_FCALL                                               'array_pop'
         12        SEND_REF                                                 !1
         13        DO_ICALL                                         $10     
         14        SEND_VAR_NO_REF                               0          $10
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !2, $11
    9    17        INIT_FCALL                                               'explode'
         18        SEND_VAR                                                 !2
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !3, $13
   10    22        INIT_FCALL                                               'array_pop'
         23        SEND_REF                                                 !3
         24        DO_ICALL                                         $15     
         25        CONCAT                                           ~16     !2, $15
         26        ASSIGN                                                   !4, ~16
   11    27        INIT_FCALL                                               'implode'
         28        SEND_VAR                                                 !2
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                         $18     
         31        ASSIGN                                                   !5, $18
   13    32        CONCAT                                           ~20     'First+part%3A+', !5
         33        CONCAT                                           ~21     ~20, '%0A'
         34        ECHO                                                     ~21
   14    35        CONCAT                                           ~22     'Last+part%3A+', !4
         36        CONCAT                                           ~23     ~22, '%0A'
         37        ECHO                                                     ~23
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
234.54 ms | 1396 KiB | 23 Q