3v4l.org

run code in 300+ PHP versions simultaneously
<?php $torrent = 'd8:announce37:http://blender.waag.org:6969/announce13:creation datei1212070099e4:infod6:lengthi196898674e4:name30:big_buck_bunny_720p_stereo.ogg12:piece lengthi262144e6:pieces15040:DñÀsÑ45/'; $regex = "/lengthi([0-9]+)e/i"; $sizes = array(); preg_replace_callback($regex, function($matches) use(&$sizes) { $sizes[] = $matches[1]; }, $torrent); var_dump($sizes); // I want to get "262144", you can see this just before "pieces", top right
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0oWi4
function name:  (null)
number of ops:  14
compiled vars:  !0 = $torrent, !1 = $regex, !2 = $sizes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'd8%3Aannounce37%3Ahttp%3A%2F%2Fblender.waag.org%3A6969%2Fannounce13%3Acreation+datei1212070099e4%3Ainfod6%3Alengthi196898674e4%3Aname30%3Abig_buck_bunny_720p_stereo.ogg12%3Apiece+lengthi262144e6%3Apieces15040%3AD%C3%B1%C3%80s%C3%9145%2F'
    5     1        ASSIGN                                                   !1, '%2Flengthi%28%5B0-9%5D%2B%29e%2Fi'
    7     2        ASSIGN                                                   !2, <array>
    9     3        INIT_FCALL                                               'preg_replace_callback'
          4        SEND_VAR                                                 !1
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F0oWi4%3A9%240'
          6        BIND_LEXICAL                                             ~6, !2
   13     7        SEND_VAL                                                 ~6
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   15    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F0oWi4%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0oWi4
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $matches, !1 = $sizes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   12     2        FETCH_DIM_R                                      ~3      !0, 1
          3        ASSIGN_DIM                                               !1
          4        OP_DATA                                                  ~3
   13     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F0oWi4%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.75 ms | 1395 KiB | 17 Q