| (Web-) Design und webbasierte Sprachen Tipps & Tricks, Designabgleich, HTML & Javascript, Flash, ASP, PHP, Perl/CGI... |
Diskussion: php type-hinting im Forum (Web-) Design und webbasierte Sprachen, in der Kategorie Web, Network & Multimedia Palace; Anzeige Gerade eben ist mir etwas sehhhrr komisches aufgefallen: PHP-Code: class OmgType { protected $foo ; protected $bar ; } ...
![]() |
| | #1 (permalink) |
| Registriert seit: 13.02.06 ![]() Likes: 1 | php type-hinting Anzeige Gerade eben ist mir etwas sehhhrr komisches aufgefallen: PHP-Code: Output bei mir: Code: bool(false) string(4) "test" funktioniert typechecking nur mit built-in types wie array ? // fail hab auf beiden maschinen das ganze in symfony getestet d.h liegt wohl am error-handler vom symfony-framework. Geändert von b4ck (08.02.11 um 11:20 Uhr) |
| | |
| | #2 (permalink) | ||
| Registriert seit: 07.05.07 ![]() Likes: 19 | Jep ![]() Code: sheeep@weide:~$ php -v
PHP 5.3.3-1ubuntu9.3 with Suhosin-Patch (cli) (built: Jan 12 2011 16:08:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
with Suhosin v0.9.31, Copyright (c) 2007-2010, by SektionEins GmbH Code: Catchable fatal error: Argument 1 passed to testclass::testtype() must be an instance of OmgType, string given, called in /var/www/foo.php on line 18 and defined in /var/www/foo.php on line 11
Call Stack:
0.0005 331688 1. {main}() /var/www/foo.php:0
0.0006 332396 2. testclass->testtype() /var/www/foo.php:18 PHP-Code: Code: Catchable fatal error: Argument 1 passed to Foo::one() must be an instance of integer, integer given, called in /var/www/foo.php on line 15 and defined in /var/www/foo.php on line 8
Call Stack:
0.0009 329064 1. {main}() /var/www/foo.php:0
0.0011 329740 2. Foo->one() /var/www/foo.php:15 Zitat:
//edit: Und genau so stehts auch im Manual: Zitat:
Geändert von she3p (08.02.11 um 15:05 Uhr) | ||
| | |
![]() |
| - Anzeige - | |
| |
| Themen-Optionen | |
| Ansicht | |
| |