3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkPhysicalAddressOnFile($addresses) { return (bool) count(array_filter($addresses, function($address) { return !preg_match("/p\.o\. box|p\.o box|po box|po\. box|pobox|post office box/i", $address); })); } echo "First test:\n"; var_dump(checkPhysicalAddressOnFile([ "P.O. box 123", "123 Main St" ])); echo "\nSecond test:\n"; var_dump(checkPhysicalAddressOnFile([ "P.O. box 123", "Post Office Box 999" ]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JQQpA
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'First+test%3A%0A'
   11     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'checkphysicaladdressonfile'
   12     3        SEND_VAL                                                 <array>
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
   16     7        ECHO                                                     '%0ASecond+test%3A%0A'
   17     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'checkphysicaladdressonfile'
   18    10        SEND_VAL                                                 <array>
         11        DO_FCALL                                      0  $2      
         12        SEND_VAR                                                 $2
         13        DO_ICALL                                                 
   20    14      > RETURN                                                   1

Function checkphysicaladdressonfile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JQQpA
function name:  checkPhysicalAddressOnFile
number of ops:  10
compiled vars:  !0 = $addresses
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJQQpA%3A4%240'
    6     4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        COUNT                                            ~3      $2
          7        BOOL                                             ~4      ~3
          8      > RETURN                                                   ~4
    7     9*     > RETURN                                                   null

End of function checkphysicaladdressonfile

Function %00%7Bclosure%7D%2Fin%2FJQQpA%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JQQpA
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $address
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2Fp%5C.o%5C.+box%7Cp%5C.o+box%7Cpo+box%7Cpo%5C.+box%7Cpobox%7Cpost+office+box%2Fi'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        BOOL_NOT                                         ~2      $1
          6      > RETURN                                                   ~2
    6     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJQQpA%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.12 ms | 1407 KiB | 21 Q