3v4l.org

run code in 300+ PHP versions simultaneously
<?php $patern = '<html> <head> <link href="templates/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <title>TEST</title> </head> <body> <table class="table table-striped table-hover"> <thead> <tr> <th>#</th> <th>Title</th> <th>Category</th> <th>date</th> <th>Options</th> </tr> </thead> <tbody> {_begin_foreach=[atable]_} <tr> <td class="col-md-1">{_[atable.count]_}</td> <td class="col-md-3"><a href="#">{_[atable.title]_}</a></td> <td>{_[atable.category_id]_}</td> <td>{_[atable.date]_}</td> <td class="col-md-3"> <a href="#" id="{_[atable.id]_}" class="btn btn-primary edit">Edit</a> <a href="#" id="{_[atable.id]_}" class="btn btn-warning delete">Delete</a> </td> </tr> {_end_foreach=[atable]_} </tbody> </table> </body> </html>'; $fornum = preg_match_all("/\{_begin_foreach=\[(.*)\]_\}([\s\S]*?)\{_end_foreach=\[\1\]_\}/smu", $patern, $foreach); var_dump($fornum); var_dump($foreach);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkXQc
function name:  (null)
number of ops:  14
compiled vars:  !0 = $patern, !1 = $fornum, !2 = $foreach
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%0A%09%3Chead%3E%0A++++++++%3Clink+href%3D%22templates%2Fbootstrap%2Fcss%2Fbootstrap.min.css%22+rel%3D%22stylesheet%22%3E%0A%09%09%3Ctitle%3ETEST%3C%2Ftitle%3E%0A%09%3C%2Fhead%3E%0A%09%3Cbody%3E%0A%09%3Ctable+class%3D%22table+table-striped+table-hover%22%3E%0A++++++++++++++++%3Cthead%3E%0A++++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++%3Cth%3E%23%3C%2Fth%3E%0A++++++++++++++++++++%3Cth%3ETitle%3C%2Fth%3E%0A++++++++++++++++++++%3Cth%3ECategory%3C%2Fth%3E%0A++++++++++++++++++++%3Cth%3Edate%3C%2Fth%3E%0A++++++++++++++++++++%3Cth%3EOptions%3C%2Fth%3E%0A++++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++%3C%2Fthead%3E%0A++++++++++++++++%3Ctbody%3E%0A+++++++++++++++++%7B_begin_foreach%3D%5Batable%5D_%7D%0A++++++++++++++++++++%3Ctr%3E%0A%09%09%09%09%09+++%09%3Ctd+class%3D%22col-md-1%22%3E%7B_%5Batable.count%5D_%7D%3C%2Ftd%3E%0A%09%09%09%09%09%09%3Ctd+class%3D%22col-md-3%22%3E%3Ca+href%3D%22%23%22%3E%7B_%5Batable.title%5D_%7D%3C%2Fa%3E%3C%2Ftd%3E%0A%09%09%09%09%09%09%3Ctd%3E%7B_%5Batable.category_id%5D_%7D%3C%2Ftd%3E%0A%09%09%09%09%09%09%3Ctd%3E%7B_%5Batable.date%5D_%7D%3C%2Ftd%3E%0A%09%09%09%09%09%09%3Ctd+class%3D%22col-md-3%22%3E%0A%09%09%09%09%09%09%09%3Ca+href%3D%22%23%22+id%3D%22%7B_%5Batable.id%5D_%7D%22+class%3D%22btn+btn-primary+edit%22%3EEdit%3C%2Fa%3E%0A%09%09%09%09%09%09%09%3Ca+href%3D%22%23%22+id%3D%22%7B_%5Batable.id%5D_%7D%22+class%3D%22btn+btn-warning+delete%22%3EDelete%3C%2Fa%3E%0A%09%09%09%09%09%09%3C%2Ftd%3E%0A%09%09%09%09%09%09%3C%2Ftr%3E%0A+++++++++++++++++%7B_end_foreach%3D%5Batable%5D_%7D%0A++++++++++++++++%3C%2Ftbody%3E%0A++++++++++++++%3C%2Ftable%3E%0A%09%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   35     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5C%7B_begin_foreach%3D%5C%5B%28.%2A%29%5C%5D_%5C%7D%28%5B%5Cs%5CS%5D%2A%3F%29%5C%7B_end_foreach%3D%5C%5B%01%5C%5D_%5C%7D%2Fsmu'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !2
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
   36     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   37    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.05 ms | 1396 KiB | 17 Q