| 
 Posted by Alvaro G. Vicario on 08/31/06 18:35 
*** Manikandan escribió/wrote (30 Aug 2006 04:43:29 -0700): 
> if ( $forecast['day_sequence'] < 4 ) { 
>  
> I got the "segmentation fault" error message when i executed this 
> script in CLI. After debugging, i had changed my code to 
>  
> if ( (int) $forecast['day_sequence'] < 4 ) { 
>  
> and its worked well. So its means my php version dont do typecasting 
> automatically it seems. 
>  
> Is it true? 
 
Nope. A segmentation fault is normally a bug in the PHP interpreter or some 
other system library. Bad code may help to trigger it some times but it's 
always an unexpected result: ideally, PHP should complain if necessary but 
not crash. 
 
I've tried this code: 
 
<?php 
 
class Foo{ 
} 
 
$foo=new Foo(); 
 
if($foo < 4){ 
	echo "foo is less than four\n"; 
} 
 
?> 
 
The condition is true and it also raises a notice: "Notice: Object of class 
Foo could not be converted to int" 
 
--  
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain 
++ Mi sitio sobre programación web: http://bits.demogracia.com 
+- Mi web de humor con rayos UVA: http://www.demogracia.com 
--
 
  
Navigation:
[Reply to this message] 
 |