Foros del Web » Programando para Internet » PHP »

Notice: Array to string conversion

Estas en el tema de Notice: Array to string conversion en el foro de PHP en Foros del Web. @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código PHP: Ver original <?php     class Query {         var $type ;         var $action ...
  #1 (permalink)  
Antiguo 04/01/2012, 15:49
Avatar de ClubIce  
Fecha de Ingreso: diciembre-2008
Mensajes: 216
Antigüedad: 15 años, 4 meses
Puntos: 2
Pregunta Notice: Array to string conversion

Código PHP:
Ver original
  1. <?php
  2.     class Query {
  3.         var $type;
  4.         var $action;
  5.         var $param;
  6.         function __construct($type,$action,$param) {
  7.             $this->$action = $action;
  8.             $this->$type = $type;
  9.             $this->$param = $param;
  10.         }
  11.     }
  12.     function parse_query($q) {
  13.         $type = ord(substr($q,0,1));
  14.         $action = ord(substr($q,1,1));
  15.         $len = ord(substr($q,2,1));
  16.         $param = array();
  17.         return new Query($type,$action,$param);
  18.     }
  19. ?>

me pueden explicar porque sucede y como lo arreglo?
  #2 (permalink)  
Antiguo 04/01/2012, 16:05
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Notice: Array to string conversion

Esto no se usa así, a menos que sepas lo que hace.
Código PHP:
// MAL
$this->$action $action;

// BIEN
$this->action $action
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #3 (permalink)  
Antiguo 04/01/2012, 16:11
Avatar de ClubIce  
Fecha de Ingreso: diciembre-2008
Mensajes: 216
Antigüedad: 15 años, 4 meses
Puntos: 2
Respuesta: Notice: Array to string conversion

ah, ya entendi, no me fije en ese detalla en el Manual de Instruccion. (?)

Etiquetas: conversion, notice, string
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 04:05.