3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Business Rule X0000-005 - The XML data has failed schema validation. cvc-maxInclusive-valid. Value '3144' is not facet-valid with respect to maxInclusive '2500' for type '#AnonType_StudentLoanInterestDedAmtIRS1040Type'. Field/Xpath:/efile:Return[1]/efile:ReturnData[1]/efile:IRS1040[1]/efile:StudentLoanInterestDedAmt["; $nonxmlbusrules_short = '/(?:Rule[\s])([a-zA-Z][0-9a-zA-Z]*[\-][0-9a-zA-Z]*)/'; $allbusrules = '/((?:Rule[\s])([a-zA-Z]{3}|[a-zA-z]{2}[0-9]{1})*[\-][0-9]*([-0-9]*)?)/'; $xmlbusrules = '/(X0000-005)/'; $nonxmlbusrules_long = '/(?:Rule[\s])([0-9a-zA-Z]*[\-][0-9a-zA-Z]*([\-][0-9a-zA-Z]*)?([-0-9]*)?)/'; $xpath_matcher = '/(?:Field\/Xpath:)[\s]*(.*)/'; // Match non-xml short business rules preg_match_all($nonxmlbusrules_short, $str, $matches[1]); $busRules_arr_short = $matches; // Match all business rules according to the pattern preg_match_all($allbusrules, $str, $matches[1]); $busRules_arr = $matches; // Match xml business rules and merge them into the all-rules preg_match_all($xmlbusrules, $str, $matches); $busRules_arr=array_merge($busRules_arr,$matches[1]); // Match non-XML long business rules and merge them into the all-rules preg_match_all($nonxmlbusrules_long, $str, $matches); $busRules_arr = array_merge($busRules_arr,$matches[1]); preg_match_all($xpath_matcher, $str, $matches); $xPath_arr = $matches[1]; $xPath_arr = preg_replace("(\[.*?\])", '', $xPath_arr); $xPath_arr = preg_replace("(\[*?)", '', $xPath_arr); foreach ($busRules_arr as $idx => $brule) { if (trim(strtolower($brule)) =='x0000-005') { echo "ITS AN XML RULE!"; }} print_r($busRules_arr[1]); print_r($xPath_arr);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
Fatal error: Uncaught TypeError: strtolower(): Argument #1 ($string) must be of type string, array given in /in/sBlMH:31 Stack trace: #0 /in/sBlMH(31): strtolower(Array) #1 {main} thrown in /in/sBlMH on line 31
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 7.3.24 - 7.3.33, 7.4.12 - 7.4.33
Warning: strtolower() expects parameter 1 to be string, array given in /in/sBlMH on line 31 ITS AN XML RULE!ITS AN XML RULE!X0000-005Array ( [0] => /efile:Return/efile:ReturnData/efile:IRS1040/efile:StudentLoanInterestDedAmt )

preferences:
187.59 ms | 409 KiB | 5 Q