 
 ;; missing: get-block, split-string
 ;; check: dolist
-;; (defun php-get-undeclared-variables (start end)
-;;   "Get a list of undeclared variables of the surrounding block.
-;; \(Doesn't deal with list\(...\) = yet\)"
-;;   (interactive "r")
-;;   (let ((vars nil)
-;;         (code-block (buffer-substring start end)))
-;; use call-process-region ?
-;;     (setq ret (shell-command-to-string (format "get-undeclared-vars.php - %s" block)))
-;;     (if (string= ret "")
-;;         (message "No undeclared variables")
-;;         (setq vars (split-string "\n" ret))
-;;         (dolist (vars v)
-;;           (setq v (split-string ";"))
-;;           (message (car v))))))
+(defun php-get-undeclared-variables (start end)
+  "Get a list of undeclared variables of the surrounding block.
+\(Doesn't deal with list\(...\) = yet\)"
+  (interactive "r")
+  (let ((code-block (buffer-substring start end))
+        (tmp-name (make-temp-name "/tmp/phpvars"))
+        vars)
+    ;; use call-process-region ?
+    (with-temp-file tmp-name
+      (insert code-block))
+    (setq ret (shell-command-to-string (format "get-undeclared-vars.php -r %s" tmp-name)))
+    (delete-file tmp-name)
+    (if (string= ret "")
+        (message "No undeclared variables")
+        (message (substring ret 0 -1))
+        ;; (setq vars (split-string ret "\n"))
+        ;; (message (format "RET: %s" vars))
+        ;; (dolist (v vars)
+        ;;   (message v)
+        ;;   (setq v (split-string v ";"))
+        ;;   (message (car v))
+          )))
 
 
 (defun css-charset-auto-coding-function (size)

           (tp (substring tfn 0 l))
           (bp (substring bft 0 (min l (length bft)))))
      (when (string-equal tp bp)
        (message "* yup update TAGS *")
        (update-tag-file)))
    (php-check-syntax)))


    t))

(defun php-debug-file ()
  "Run file in CLI with debugger enabled. geben is an emacs
frontend for xdebug"
  (interactive)
  (if (not (buffer-modified-p))
      (async-shell-command (format "export  XDEBUG_CONFIG=\"idekey=geben-xdebug\"; php -f %s" (buffer-file-name)))
