Dubluve.net » strict standarts http://dubluve.net Biz de yazılımcıyız Wed, 16 Jul 2014 16:39:40 +0000 tr-TR hourly 1 http://wordpress.org/?v=3.5.2 php strict standards – only variables should be passed by reference error http://dubluve.net/2013/03/21/php-strict-standards-only-variables-should-be-passed-by-reference-error/ http://dubluve.net/2013/03/21/php-strict-standards-only-variables-should-be-passed-by-reference-error/#comments Thu, 21 Mar 2013 21:44:53 +0000 Emre Macit http://dubluve.net/?p=2553 strict standards - only variables should be passed by reference error hatasını alıyorsanız, referans olarak değişken göndermeniz gereken yere, siz farklı bir şey göndermişsiniz demektir.

Ben hatayı şöyle almıştım.

$var = end(explode( "/", $filename ));

end işlemini yaptığım şey explode işleminin sonucu. Ancak explode bir array döndürürken, bu arrayi bir değişkene atamadığım için, arrayin sadece adresini döndürmüş oluyor. Bu da end fonksiyonunun çalışmamasına sebep oluyor.

Çalışması için aşağıdaki gibi basit bir düzenleme yapıyoruz :

$tmpArr= explode( "/", $filename);
$var = end($tmpArr);

Bu problem php 5.4.x sürümlerinde karşınıza çıkmıyor ancak php 5.3.x sürümlerinde mevcuttur.

]]>
http://dubluve.net/2013/03/21/php-strict-standards-only-variables-should-be-passed-by-reference-error/feed/ 5