<?php
class x {
function foo() {
print "\nfoo";
}
}
$x = new x();
$test = array($x, "foo");
echo is_callable($test) ? 'This is a callable' : 'This is not a callable';
echo "\n";
echo is_array($test) ? 'This is an array' : 'This is not an array';
$test();
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
This is a callable
This is an array
foo