3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Copied from tests/_support/Commands/Foobar.php $template = "<?php use Config\App; use CodeIgniter\CLI\CLI; return [ 'foo' => 'The command will use this as foo.', 'bar' => 'The command will use this as bar.', 'baz' => 'The baz is here.', 'bas' => CLI::color('bas', 'green') . (new App())->baseURL, ]; "; preg_match( '/(?P<imports>(?:^use [^;]+;$\n?)+)/m', $template, $match ); var_dump($match); // empty 'imports'
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WeqvU
function name:  (null)
number of ops:  10
compiled vars:  !0 = $template, !1 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fphp%0A%0Ause+Config%5CApp%3B%0Ause+CodeIgniter%5CCLI%5CCLI%3B%0A%0Areturn+%5B%0A+++%27foo%27+%3D%3E+%27The+command+will+use+this+as+foo.%27%2C%0A+++%27bar%27+%3D%3E+%27The+command+will+use+this+as+bar.%27%2C%0A+++%27baz%27+%3D%3E+%27The+baz+is+here.%27%2C%0A+++%27bas%27+%3D%3E+CLI%3A%3Acolor%28%27bas%27%2C+%27green%27%29+.+%28new+App%28%29%29-%3EbaseURL%2C%0A%5D%3B%0A'
   16     1        INIT_FCALL                                               'preg_match'
   17     2        SEND_VAL                                                 '%2F%28%3FP%3Cimports%3E%28%3F%3A%5Euse+%5B%5E%3B%5D%2B%3B%24%5Cn%3F%29%2B%29%2Fm'
   18     3        SEND_VAR                                                 !0
   19     4        SEND_REF                                                 !1
   16     5        DO_ICALL                                                 
   22     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.92 ms | 984 KiB | 15 Q