3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Seats: 11;12; Name: qqqq;wwww; Start: Прешов, АВ Košická 2725/2 End: Мукачево, АЗ Лавковская, 1б Date: 2019-06-22 Time: 09:40 PM"; $lines = explode("\n", trim($str)); $data = array_reduce($lines, function($res, $line){ [$key, $value] = preg_split('#\s*:\s*#', $line, 2); $res[$key] = $value; return $res; }, []); var_dump($data); preg_match_all('#(\d+);#', $data['Seats'], $m); var_dump($m[1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2qeuO
function name:  (null)
number of ops:  30
compiled vars:  !0 = $str, !1 = $lines, !2 = $data, !3 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Seats%3A+11%3B12%3B%0AName%3A+qqqq%3Bwwww%3B%0AStart%3A+%D0%9F%D1%80%D0%B5%D1%88%D0%BE%D0%B2%2C+%D0%90%D0%92+Ko%C5%A1ick%C3%A1+2725%2F2%0AEnd%3A+%D0%9C%D1%83%D0%BA%D0%B0%D1%87%D0%B5%D0%B2%D0%BE%2C+%D0%90%D0%97+%D0%9B%D0%B0%D0%B2%D0%BA%D0%BE%D0%B2%D1%81%D0%BA%D0%B0%D1%8F%2C+1%D0%B1%0ADate%3A+2019-06-22%0ATime%3A+09%3A40+PM'
   10     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%0A'
          3        INIT_FCALL                                               'trim'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !1, $6
   11     9        INIT_FCALL                                               'array_reduce'
         10        SEND_VAR                                                 !1
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2qeuO%3A11%240'
   15    12        SEND_VAL                                                 ~8
         13        SEND_VAL                                                 <array>
         14        DO_ICALL                                         $9      
   11    15        ASSIGN                                                   !2, $9
   17    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
   19    19        INIT_FCALL                                               'preg_match_all'
         20        SEND_VAL                                                 '%23%28%5Cd%2B%29%3B%23'
         21        FETCH_DIM_R                                      ~12     !2, 'Seats'
         22        SEND_VAL                                                 ~12
         23        SEND_REF                                                 !3
         24        DO_ICALL                                                 
   20    25        INIT_FCALL                                               'var_dump'
         26        FETCH_DIM_R                                      ~14     !3, 1
         27        SEND_VAL                                                 ~14
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F2qeuO%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2qeuO
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $res, !1 = $line, !2 = $key, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        INIT_FCALL                                               'preg_split'
          3        SEND_VAL                                                 '%23%5Cs%2A%3A%5Cs%2A%23'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 2
          6        DO_ICALL                                         $4      
          7        FETCH_LIST_R                                     $5      $4, 0
          8        ASSIGN                                                   !2, $5
          9        FETCH_LIST_R                                     $7      $4, 1
         10        ASSIGN                                                   !3, $7
         11        FREE                                                     $4
   13    12        ASSIGN_DIM                                               !0, !2
         13        OP_DATA                                                  !3
   14    14      > RETURN                                                   !0
   15    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2qeuO%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.11 ms | 1400 KiB | 25 Q