The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
I get a error in this function first - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: I get a error in this function first (/showthread.php?tid=654)



I get a error in this function first - marceloatmartins - 08-01-2017

Hi Everybody,

I get a error in function first in DB Class.

public function first(){
return $this->results()[0];
}

I don't understand this sintaxe: return $this->results()[0];

Is the [0] a paramter?

Help me please
Thanks




I get a error in this function first - marceloatmartins - 08-01-2017

Help me please

My doubt is:

If the [0] means the element 0 of array resulting of method 'results' how can I get this with other way?

Thanks



I get a error in this function first - firestorm - 08-01-2017

you need to give a bit more info, where are you seeing the error? what changes have you made etc etc


I get a error in this function first - marceloatmartins - 08-01-2017

Hi Everybody,

After a few hours banging my head against the wall, I tryed this and it's worked:

return current( $this->results() );


My PHP is 5.3.27 on server production.

If anyone had the same problem, try it.

Thanks