3v4l.org

run code in 300+ PHP versions simultaneously
<?php $address = '5e Dorpsstraat 41B'; $matchArr = array(); preg_match('/(\d+)/U', $address, $matchArr); var_dump($matchArr); $number = 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/IaYU5
function name:  (null)
number of ops:  36
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'
          3        SEND_VAL                                                 '%2F%28%5Cd%2B%29%2FU'
          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        SEND_REF                                                 !1
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !2, $10
    9    14        INIT_FCALL                                               'explode'
         15        SEND_VAR                                                 !2
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $12     
         18        ASSIGN                                                   !3, $12
   10    19        INIT_FCALL                                               'array_pop'
         20        SEND_REF                                                 !3
         21        DO_ICALL                                         $14     
         22        CONCAT                                           ~15     !2, $14
         23        ASSIGN                                                   !4, ~15
   11    24        INIT_FCALL                                               'implode'
         25        SEND_VAR                                                 !2
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $17     
         28        ASSIGN                                                   !5, $17
   13    29        CONCAT                                           ~19     'First+part%3A+', !5
         30        CONCAT                                           ~20     ~19, '%0A'
         31        ECHO                                                     ~20
   14    32        CONCAT                                           ~21     'Last+part%3A+', !4
         33        CONCAT                                           ~22     ~21, '%0A'
         34        ECHO                                                     ~22
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.93 ms | 1388 KiB | 23 Q