3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array_fill(0,5,"~b"); $a[1] = "~a"; $begin = "{"; $end = "}"; $format2 = $begin . implode(",", $a) . $end; print_r($format2); $args = array("srinath", "kattula", "srikanth"); $params = array("name"=>$node_id, "service"=>XMPP_GROUPCHAT_SERVICE, "host"=>XMPP_HOST_DOMAIN); $args = array_values($params); print_r($args);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
{~b,~a,~b,~b,~b} Warning: Undefined variable $node_id in /in/rp6PF on line 9 Fatal error: Uncaught Error: Undefined constant "XMPP_GROUPCHAT_SERVICE" in /in/rp6PF:10 Stack trace: #0 {main} thrown in /in/rp6PF on line 10
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 {~b,~a,~b,~b,~b} Warning: Undefined variable $node_id in /in/rp6PF on line 9 Fatal error: Uncaught Error: Undefined constant "XMPP_GROUPCHAT_SERVICE" in /in/rp6PF:10 Stack trace: #0 {main} thrown in /in/rp6PF on line 10
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
{~b,~a,~b,~b,~b} Notice: Undefined variable: node_id in /in/rp6PF on line 9 Warning: Use of undefined constant XMPP_GROUPCHAT_SERVICE - assumed 'XMPP_GROUPCHAT_SERVICE' (this will throw an Error in a future version of PHP) in /in/rp6PF on line 10 Warning: Use of undefined constant XMPP_HOST_DOMAIN - assumed 'XMPP_HOST_DOMAIN' (this will throw an Error in a future version of PHP) in /in/rp6PF on line 11 Array ( [0] => [1] => XMPP_GROUPCHAT_SERVICE [2] => XMPP_HOST_DOMAIN )
Output for 7.3.32 - 7.3.33
{~b,~a,~b,~b,~b} Warning: Use of undefined constant XMPP_GROUPCHAT_SERVICE - assumed 'XMPP_GROUPCHAT_SERVICE' (this will throw an Error in a future version of PHP) in /in/rp6PF on line 10 Warning: Use of undefined constant XMPP_HOST_DOMAIN - assumed 'XMPP_HOST_DOMAIN' (this will throw an Error in a future version of PHP) in /in/rp6PF on line 11 Array ( [0] => [1] => XMPP_GROUPCHAT_SERVICE [2] => XMPP_HOST_DOMAIN )
Output for 5.5.0 - 5.5.37, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25
{~b,~a,~b,~b,~b} Notice: Undefined variable: node_id in /in/rp6PF on line 9 Notice: Use of undefined constant XMPP_GROUPCHAT_SERVICE - assumed 'XMPP_GROUPCHAT_SERVICE' in /in/rp6PF on line 10 Notice: Use of undefined constant XMPP_HOST_DOMAIN - assumed 'XMPP_HOST_DOMAIN' in /in/rp6PF on line 11 Array ( [0] => [1] => XMPP_GROUPCHAT_SERVICE [2] => XMPP_HOST_DOMAIN )

preferences:
210.59 ms | 403 KiB | 235 Q