Annotation of embedaddon/php/scripts/dev/generate-phpt/src/codeSnippets/object.txt, revision 1.1
1.1 ! misho 1: function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
! 2: if (error_reporting() != 0) {
! 3: // report non-silenced errors
! 4: echo "Error: $err_no - $err_msg, $filename($linenum)\n";
! 5: }
! 6: }
! 7: set_error_handler('test_error_handler');
! 8:
! 9:
! 10:
! 11: class classWithToString
! 12: {
! 13: public function __toString() {
! 14: return "Class A object";
! 15: }
! 16: }
! 17:
! 18: class classWithoutToString
! 19: {
! 20: }
! 21:
! 22: $variation_array = array(
! 23: 'instance of classWithToString' => new classWithToString(),
! 24: 'instance of classWithoutToString' => new classWithoutToString(),
! 25: );
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>